package com.seu.project.seuquiz.model.converter;

import com.seu.project.seuquiz.model.dto.notice.NoticeUpdateRequest;
import com.seu.project.seuquiz.model.entity.Notice;

/**
 * @author SoftPro
 * @createDate: 2023-07-22 19:43
 */
public class NoticeConverter {
    public static Notice noticeQueryRequestToNotice(NoticeUpdateRequest updateRequest) {
        if (updateRequest == null) {
            return null;
        }
        Notice notice = new Notice();
        notice.setId(updateRequest.getId());
        notice.setTitle(updateRequest.getTitle());
        notice.setDescription(updateRequest.getDescription());
        notice.setContent(updateRequest.getContent());
        notice.setStatus(updateRequest.getStatus());
        return notice;
    }
}
